package com.reyco1.services.flickr
{
	public class FlickrPhotoData
	{
		private const PHOTO_URI:String  = "http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg";
		private const THUMB_URI:String  = "http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}_t.jpg";
		
		protected var _id:String;
		protected var _owner:String;
		protected var _secret:String;
		protected var _server:String;
		protected var _farm:String;
		protected var _title:String;
		protected var _isFriend:String;
		protected var _isFamily:String;
		protected var _thumbURL:String;
		protected var _url:String;
		
		public function FlickrPhotoData()
		{
			super();
		}
		
		public function populate(xml:XML):void
		{
			_id 	  = xml.@id;
			_owner    = xml.@owner;
			_secret   = xml.@secret;
			_server   = xml.@server;
			_farm 	  = xml.@farm;
			_title 	  = xml.@title;
			_isFriend = xml.@isFriend;
			_isFamily = xml.@isFamily;			
			_thumbURL = THUMB_URI.replace("{farm-id}", _farm).replace("{server-id}", _server).replace("{id}", _id).replace("{secret}", _secret);
			_url 	  = PHOTO_URI.replace("{farm-id}", _farm).replace("{server-id}", _server).replace("{id}", _id).replace("{secret}", _secret);
		}
		
		public function get thumbURL():String
		{
			return _thumbURL;
		}
		
		public function set thumbURL(value:String):void
		{
			_thumbURL = value;
		}
		
		public function get isFamily():String
		{
			return _isFamily;
		}
		
		public function set isFamily(value:String):void
		{
			_isFamily = value;
		}
		
		public function get isFriend():String
		{
			return _isFriend;
		}
		
		public function set isFriend(value:String):void
		{
			_isFriend = value;
		}
		
		public function get title():String
		{
			return _title;
		}
		
		public function set title(value:String):void
		{
			_title = value;
		}
		
		public function get farm():String
		{
			return _farm;
		}
		
		public function set farm(value:String):void
		{
			_farm = value;
		}
		
		public function get server():String
		{
			return _server;
		}
		
		public function set server(value:String):void
		{
			_server = value;
		}
		
		public function get secret():String
		{
			return _secret;
		}
		
		public function set secret(value:String):void
		{
			_secret = value;
		}
		
		public function get owner():String
		{
			return _owner;
		}
		
		public function set owner(value:String):void
		{
			_owner = value;
		}
		
		public function get id():String
		{
			return _id;
		}
		
		public function set id(value:String):void
		{
			_id = value;
		}
		
		public function get url():String
		{
			return _url;
		}
		
		public function set url(value:String):void
		{
			_url = value;
		}
		
	}
}